(async function () {
	var sites = require('../utils/sites')
	var Dm5 = require('../plugin/dm5')
  	var dm5= new Dm5()
	let a = await dm5.getComicCategory()
	for(let i= 0;i<a.length;i++){
	    comicSrc='漫画下载/'+a[i].name
	  	await sites.createDir(comicSrc)
	  	let b = await dm5.getComicPageList(a[i].categoryUrl)
	  	for(let j=0;j<b.length;j++){
			let c = await dm5.getComicList(b[j].pageUrl)
			for(let k = 0;k<c.length;k++){
		  		let d = await dm5.getComicSynopsis(c[k].url)
		  		sites.writeData(d,comicSrc+'/'+c[k].name+'.json')
		  		console.info(comicSrc+'/'+c[k].name+'.json 写入成功')
			}    
	  	}      
	}
	  
}())